package test45;

import java.io.*;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-05-18
 * Time: 15:41
 */
public class Main1 {
    static Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            String[] words = new String[n];
            for (int i = 0; i < n; i++) {
                words[i] = scanner.next();
            }
            String word = scanner.next();
            int k = scanner.nextInt();
            int[] original = new int[26];
            for (int i = 0; i < word.length(); i++) {
                original[word.charAt(i) - 'a']++;
            }
            List<String> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                if (judge(original, words[i], word)) {
                    list.add(words[i]);
                }
            }
            Collections.sort(list);
            bw.write(list.size() + "\n");
            if (k <= list.size()) {
                bw.write(list.get(k - 1) + "\n");
            }
        }
        bw.close();
        scanner.close();
    }

    public static boolean judge(int[] original, String str, String word) {
        if (str.equals(word)) {
            return false;
        }
        int[] now = new int[26];
        for (int i = 0; i < str.length(); i++) {
            now[str.charAt(i) - 'a']++;
        }
        for (int i = 0; i < 26; i++) {
            if (original[i] != now[i]) {
                return false;
            }
        }
        return true;
    }
}
